/**
 * Project Name:sc-parent-service
 * File Name:ProbabilityFactory.java
 * Package Name:com.sc.probabilityfactory
 * Date:2018年6月29日上午8:45:17
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.probabilityfactory;

import com.sc.probability.Probability;
import com.sc.probability.impl.AgeProbabilityImpl;
import com.sc.probability.impl.AnnualincomeProbabilityImpl;
import com.sc.probability.impl.EmptyProbabilityImpl;
import com.sc.probability.impl.GenderProbabilityImpl;
import com.sc.probability.impl.HasHouseCountProbabilityImpl;
import com.sc.probability.impl.MoneyProbabilityImpl;

/**
 * Description:  这里有点设计过度  <br/>
 * Date:     2018年6月29日 上午8:45:17 <br/>
 * @author   tianyongxu
 * @version
 * @see
 */
public class ProbabilityFactory {

    public static final int AGE = 1;
    public static final int ANNUALINCOME= 2;
    public static final int GENDER = 3;
    public static final int HASHOUSECOUNT = 4;
    public static final int MONEY = 5;
    
    public static Probability createProbability(int type){
        
        switch (type) {
        case AGE:
            return new AgeProbabilityImpl();//创建计算年龄的概率值对象
        case ANNUALINCOME:
            return new AnnualincomeProbabilityImpl();//创建计算年收入的概率值对象
        case GENDER:
            return new GenderProbabilityImpl();//创建计算性别的概率值对象
        case HASHOUSECOUNT:
            return new HasHouseCountProbabilityImpl();//创建计算年龄的概率值对象
        case MONEY:
            return new MoneyProbabilityImpl();//创建计算年年收入概率值对象
        default:
            return new EmptyProbabilityImpl();//为了防止空对象的对象
        }
    }
    
    
}

